<?php
namespace app\superAdmin\controller;
use \think\Controller;
use \think\Db;


class Collect extends Controller 
{
	public function index()
    {
    	$collects = Db::name('collecion_ck')
    	->alias('c')
    	->join('template_ck t','t.tid = c.tid')
    	->select();
    	$this->assign("collectList",$collects);
        return $this->fetch();;
    }
    public function find(){
    	$findcid=input('findcid');
		$findtid=input('findtid');
		$finduid=input('finduid');

    	if ($findcid!=NULL) {
    		$registration=Db::name('collecion_ck')
	    	->alias('c')
	    	->join('template_ck t','t.tid = c.tid')
	    	->where("c.cid='$findcid'")
	    	->select();
		    $this->assign("collectList",$registration);
		    return $this->fetch("index");
    	}elseif ($findtid!=NULL) {
    		$registration=Db::name('collecion_ck')
	    	->alias('c')
	    	->join('template_ck t','t.tid = c.tid')
	    	->where("c.tid='$findtid'")
	    	->select();
	    	$this->assign("collectList",$registration);
		    return $this->fetch("index");
    	}elseif ($finduid!=NULL) {
    		$registration=Db::name('collecion_ck')
	    	->alias('c')
	    	->join('template_ck t','t.tid = c.tid')
	    	->where("c.uid='$finduid'")
	    	->select();
	    	$this->assign("collectList",$registration);
		    return $this->fetch("index");
    	}else{
    		$registration=Db::name('collecion_ck')
	    	->alias('c')
	    	->join('template_ck t','t.tid = c.tid')
	    	->select();
	    	$this->assign("collectList",$registration);
		    return $this->fetch("index");
    	}
    }
}